﻿-- =============================================
-- Author:		<Author,XFL>
-- Create date: <Create Date,20111228>
-- Description:	<Description,通过用户ID 获取用户的相关信息>
-- =============================================
CREATE PROCEDURE [dbo].[proc_Users_GetItem_UserId_new20111228] 
	-- Add the parameters for the stored procedure here
	@UserId int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering ;WITH SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	Select
	UserId,
	UserName,
	Password,
	RTX,
	Email,
	CompanyId,
	[Name],
	CreateDate,
	IsLockout,
	isnull(LastLoginDate,'1900-01-01') as LastLoginDate,
	FailedPasswordAttemptCount,
	ISNULL([DepartmentId],0) AS[DepartmentId], --- 部门ID
	ISNULL([UserInRoles],'--') AS [UserInRoles], ---权限参数
	[IsDelete] ---删除标记

	From aspnet_Users Where UserId=@UserId

END
